<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="s_files" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="productTecFilesChoiceSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>增加新文件</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 文件列表 </span>
      </div>
      <el-table :data="s_files">
        <el-table-column label="" prop="file_id" width="80">
          <template slot-scope="scope">
            <el-button @click="$parent.$parent.closeProductTecFilesChoice(scope.row['file_id'],scope.row['deploy_file']);" type="success" size="mini"><i class="fa fa-edit"></i>选择</el-button>
          </template>
        </el-table-column>
        <el-table-column label="文件名称" prop="file_id">
          <template slot-scope="scope">
            <el-link @click="gotoPage('/xcapi/ProcessFile/DownloadFile.do?&fileid='+scope.row.file_id+''+vueparams+'')" type='primary'>{{scope.row.file_name}}</el-link>
          </template>
        </el-table-column>
        <el-table-column label="文件编号" prop="file_num">
        </el-table-column>
        <el-table-column label="受控状态" prop="file_confet">
        </el-table-column>
        <el-table-column label="编写时间" prop="file_comdate">
        </el-table-column>
        <el-table-column label="编写人" prop="file_comperson">
        </el-table-column>
        <el-table-column label="文件状态" prop="">
        </el-table-column>
        <el-table-column label="审核时间" prop="file_verifydate">
        </el-table-column>
        <el-table-column label="审核人" prop="file_verify">
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
      <el-button @click="gotoPage('1F19B07F6AFB4EA79CEFCC807F489698?'+vueparams+'')" type='primary' size="mini">核对所有项目</el-button>
      <el-button @click="gotoPage('1F19B07F6AFB4EA79CEFCC807F489698?'+vueparams+'')" type='primary' size="mini">清除所有项目</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'ProductTecFilesChoice',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_files: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/product/ProductAction/productTecFilesChoice?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      productTecFilesChoiceSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/psi/product/ProductAction/productTecFilesChoiceSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/psi/product/ProductTec/productTec?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
